home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / pascal.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  7KB  |  235 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Andrew Johnson <acjgenius@earthlink.net>
  5.  Copyright (C) 2004 Andrew Johnson <acjgenius@earthlink.net>
  6.  Copyright (C) 2005 Thierry Moisan <thierryn@videotron.ca>
  7.  
  8.  This library is free software; you can redistribute it and/or modify
  9.  it under the terms of the GNU General Public License as published by
  10.  the Free Software Foundation; either version 2 of the License, or
  11.  (at your option) any later version.
  12.  
  13.  This program is distributed in the hope that it will be useful,
  14.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  GNU General Public License for more details.
  17.  
  18.  You should have received a copy of the GNU General Public License
  19.  along with this program; if not, write to the Free Software
  20.  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  21.  
  22. -->
  23. <language id="pascal" _name="Pascal" version="2.0" _section="Sources">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-pascal</property>
  26.     <property name="globs">*.p;*.pas</property>
  27.     <property name="line-comment-start">//</property>
  28.   </metadata>
  29.  
  30.   <styles>
  31.     <style id="comment" _name="Comment" map-to="def:comment"/>
  32.     <style id="string" _name="String" map-to="def:string"/>
  33.     <style id="keyword" _name="Keyword" map-to="def:keyword"/>
  34.     <style id="decimal" _name="Decimal" map-to="def:decimal"/>
  35.     <style id="type" _name="Data Type" map-to="def:type"/>
  36.     <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
  37.   </styles>
  38.  
  39.   <default-regex-options case-sensitive="false"/>
  40.  
  41.   <definitions>
  42.  
  43.     <context id="string" style-ref="string">
  44.       <start>[uUrR]?'</start>
  45.       <end>'</end>
  46.     </context>
  47.  
  48.     <context id="line-comment" style-ref="comment" end-at-line-end="true">
  49.       <start>//</start>
  50.       <include>
  51.         <context ref="def:in-comment"/>
  52.       </include>
  53.     </context>
  54.  
  55.     <context id="block-comment-1" style-ref="comment">
  56.       <start>\(\*</start>
  57.       <end>\*\)</end>
  58.       <include>
  59.         <context ref="def:in-comment"/>
  60.       </include>
  61.     </context>
  62.  
  63.     <context id="block-comment-2" style-ref="comment">
  64.       <start>\{</start>
  65.       <end>\}</end>
  66.       <include>
  67.         <context ref="def:in-comment"/>
  68.       </include>
  69.     </context>
  70.  
  71.     <context id="preprocessor-defines" style-ref="preprocessor" end-at-line-end="true">
  72.       <start>\{\$</start>
  73.       <end>\}</end>
  74.     </context>
  75.  
  76.     <context id="general-format" style-ref="keyword">
  77.       <keyword>Program</keyword>
  78.       <keyword>Library</keyword>
  79.       <keyword>Unit</keyword>
  80.       <keyword>Uses</keyword>
  81.       <keyword>Interface</keyword>
  82.       <keyword>Implementation</keyword>
  83.       <keyword>Initialization</keyword>
  84.       <keyword>Finalization</keyword>
  85.       <keyword>Begin</keyword>
  86.       <keyword>End</keyword>
  87.       <keyword>Var</keyword>
  88.       <keyword>Const</keyword>
  89.     </context>
  90.  
  91.     <context id="functions-and-function-modifiers" style-ref="keyword">
  92.       <keyword>Function</keyword>
  93.       <keyword>Procedure</keyword>
  94.       <keyword>Overload</keyword>
  95.       <keyword>cdecl</keyword>
  96.     </context>
  97.  
  98.     <context id="boolean-bitwise-operators" style-ref="keyword">
  99.       <keyword>if</keyword>
  100.       <keyword>then</keyword>
  101.       <keyword>else</keyword>
  102.       <keyword>is</keyword>
  103.       <keyword>and</keyword>
  104.       <keyword>not</keyword>
  105.       <keyword>or</keyword>
  106.       <keyword>xor</keyword>
  107.       <keyword>shr</keyword>
  108.       <keyword>shl</keyword>
  109.     </context>
  110.  
  111.     <context id="math-operators" style-ref="keyword">
  112.       <keyword>div</keyword>
  113.       <keyword>mod</keyword>
  114.     </context>
  115.  
  116.     <context id="loop-flow-and-exceptions-keywords" style-ref="keyword">
  117.       <keyword>while</keyword>
  118.       <keyword>do</keyword>
  119.       <keyword>for</keyword>
  120.       <keyword>to</keyword>
  121.       <keyword>case</keyword>
  122.       <keyword>of</keyword>
  123.       <keyword>repeat</keyword>
  124.       <keyword>until</keyword>
  125.       <keyword>break</keyword>
  126.       <keyword>continue</keyword>
  127.       <keyword>try</keyword>
  128.       <keyword>except</keyword>
  129.       <keyword>finally</keyword>
  130.       <keyword>raise</keyword>
  131.     </context>
  132.  
  133.     <context id="type-class-and-object-keywords" style-ref="keyword">
  134.       <keyword>Type</keyword>
  135.       <keyword>Packed</keyword>
  136.       <keyword>Array</keyword>
  137.       <keyword>Record</keyword>
  138.       <keyword>Object</keyword>
  139.       <keyword>Class</keyword>
  140.       <keyword>Interface</keyword>
  141.       <keyword>Public</keyword>
  142.       <keyword>Private</keyword>
  143.       <keyword>Protected</keyword>
  144.       <keyword>Constructor</keyword>
  145.       <keyword>Destructor</keyword>
  146.       <keyword>Virtual</keyword>
  147.       <keyword>Abstract</keyword>
  148.       <keyword>Override</keyword>
  149.       <keyword>Property</keyword>
  150.       <keyword>ReadLn</keyword>
  151.       <keyword>Read</keyword>
  152.       <keyword>WriteLn</keyword>
  153.       <keyword>Write</keyword>
  154.       <keyword>default</keyword>
  155.       <keyword>With</keyword>
  156.       <keyword>As</keyword>
  157.       <keyword>self</keyword>
  158.       <keyword>Inherited</keyword>
  159.     </context>
  160.  
  161.     <context id="builtin-types" style-ref="type">
  162.       <keyword>Char</keyword>
  163.       <keyword>String</keyword>
  164.       <keyword>Integer</keyword>
  165.       <keyword>Real</keyword>
  166.       <keyword>Boolean</keyword>
  167.       <keyword>Pointer</keyword>
  168.     </context>
  169.  
  170.     <context id="builtin-functions" style-ref="keyword">
  171.       <keyword>chr</keyword>
  172.       <keyword>ord</keyword>
  173.       <keyword>succ</keyword>
  174.       <keyword>pred</keyword>
  175.       <keyword>abs</keyword>
  176.       <keyword>round</keyword>
  177.       <keyword>trunc</keyword>
  178.       <keyword>sqr</keyword>
  179.       <keyword>sqrt</keyword>
  180.       <keyword>arctan</keyword>
  181.       <keyword>cos</keyword>
  182.       <keyword>sin</keyword>
  183.       <keyword>exp</keyword>
  184.       <keyword>ln</keyword>
  185.       <keyword>odd</keyword>
  186.       <keyword>eof</keyword>
  187.       <keyword>eoln</keyword>
  188.     </context>
  189.  
  190.     <context id="builtin-values" style-ref="keyword">
  191.       <keyword>nil</keyword>
  192.       <keyword>False</keyword>
  193.       <keyword>True</keyword>
  194.     </context>
  195.  
  196.     <context id="number" style-ref="decimal">
  197.       <match extended="true">
  198.         (?<![\w\.])
  199.         (([0-9]+)|([0-9]+\.[0-9]+([Ee][-]?[0-9]+)?))
  200.         (?![\w\.])
  201.       </match>
  202.     </context>
  203.  
  204.     <context id="hex-number" style-ref="decimal">
  205.       <match extended="true">
  206.         (?<![\w\.])
  207.         \$[0-9a-fA-F]*
  208.         (?![\w\.])
  209.       </match>
  210.     </context>
  211.  
  212.     <context id="pascal">
  213.       <include>
  214.         <context ref="string"/>
  215.         <context ref="line-comment"/>
  216.         <context ref="preprocessor-defines"/>
  217.         <context ref="block-comment-1"/>
  218.         <context ref="block-comment-2"/>
  219.         <context ref="general-format"/>
  220.         <context ref="functions-and-function-modifiers"/>
  221.         <context ref="boolean-bitwise-operators"/>
  222.         <context ref="math-operators"/>
  223.         <context ref="loop-flow-and-exceptions-keywords"/>
  224.         <context ref="type-class-and-object-keywords"/>
  225.         <context ref="builtin-types"/>
  226.         <context ref="builtin-functions"/>
  227.         <context ref="builtin-values"/>
  228.         <context ref="number"/>
  229.         <context ref="hex-number"/>
  230.       </include>
  231.     </context>
  232.  
  233.   </definitions>
  234. </language>
  235.